//- 实现日期格式函数
//'2020-12-01'
  const dataformat = (date,format)=>{
console.log(typeof date,Object.prototype.toString.call(date));
var day = date.getDate();
if(day < 10) {
    day = '0' + day
}
var month = date.getMonth() + 1;// 月份从零开始
if(month < 10) {
    month = '0' + month
}
var year = date.getFullYear();
format = format.replace('yyyy', year)
format = format.replace('MM', month)
format = format.replace('dd', day)
console.log(format);
  }
dataformat(new Date('2020-12-01'),'yyyy/MM/dd');
dataformat(new Date('2020-12-01') ,'yyyy年MM月dd日')
